﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="MeberShipTabUC.ascx.cs" Inherits="WebApplication.UserControl.MeberShipTabUC" %>
<script type="text/javascript">
    //    $(document).ready(function () {
    //        $("#" + tbselect).attr("class", "selected");
    //
    //    })

    //菜单数组
    var tb2arr = [
    { id: "t1", href: "../MemberShip.aspx", label: "Membership Record", width: 130 },
    { id: "t2", href: "../PaymentRecord.aspx", label: "Payment Record", width: 210}]


    //填充菜单
    function paddingTab() {
        $("#tab li").remove();
        $("#tb2 li").remove();
        var w = document.body.clientWidth;
        // var min = 10; //mini 820     
        var nl = 50; //now width;   
        for (i = 0; i < tb2arr.length; i++) {
            l = tb2arr[i].width;
            var str = '<li id=\"' + tb2arr[i].id + '\"><span><a href=\"' + tb2arr[i].href + '\">' + tb2arr[i].label + '</a></span></li>';
            if (nl < w && (nl + l) < w) {
                nl = nl + l;
                jQuery(str).appendTo("#tab");
            } else {
                jQuery(str).appendTo("#tb2");
            }

        }
        var tbselect = $("#pageName").val();
        $("#" + tbselect).attr("class", "selected");
    }



    $(document).ready(function () {
        paddingTab(); //填充菜单
        //页面缩放时
        $(window).resize(function () {
            paddingTab();
        });

    })
  

 </script>

<div class="tab-wrap">
	<div class="leftbtn">
	  <img src="../Media/Css/images/001_27.png" alt=""  height="24" />
	</div>	
	<ul  class="tab" id="tab" >
         
	</ul>		
	<%--<div class="rightbtn" id="rightbtn">
	<img src="../Media/Css/images/maintab2btn.png" alt="" height="24" />
		<ul class="tb2" id="tb2">
      
		</ul>
	</div>--%>
	</div>